package edu.uts.reekie.designer.implementation.edit;

import org.eclipse.draw2d.ConnectionAnchor;
import org.eclipse.draw2d.IFigure;

import edu.uts.reekie.designer.figures.FigureFactory;
import edu.uts.reekie.designer.implementation.figures.FileComponentFigure;
import edu.uts.reekie.designer.implementation.model.FileComponent;
import edu.uts.reekie.designer.model.ModelFactory;

public class FileComponentEditPart extends ViewComponentEditPart {

	public FileComponentEditPart(ModelFactory mf, FigureFactory ff) {
		super(mf, ff);
		setSupportsMultiple(true);
	}

	protected IFigure createFigure() {
		FileComponentFigure f = new FileComponentFigure();
		f.setName(getComponentModel().getName());
		return f;
	}
	
	FileComponent getComponentModel() {
		return (FileComponent)getModel();
	}
	
	FileComponentFigure getComponentFigure() {
		return (FileComponentFigure)getFigure();
	}

	protected ConnectionAnchor getConnectionAnchor() {
		return getComponentFigure().getAnchor();
	}
}
